﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="dpet">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>dPet</title>
	<link href="http://resource.dfancy.cn/dPet/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
	<link href="http://resource.dfancy.cn/dPet/css/advanced-left-styles.css" rel="stylesheet" type="text/css" />
	<link href="http://resource.dfancy.cn/dPet/css/style.css" rel="stylesheet" type="text/css" />

	@RenderSection("styles", required: false)
</head>
<body>
	<header>
		<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
			<div class="container-fluid">

				<div class="navbar-header">
					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
						<span class="sr-only"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="/">dPet</a>
				</div>

				@{ Html.RenderPartial("_LoginBar"); }
			</div>
		</nav>
	</header>

	<div class="page-container">
		<div id="nav_accordion" class="accordion nav-collapse" style="position:relative;">
			@{ Html.RenderPartial("_LeftNav"); }
		</div>

		<div class="main" role="main">
			@RenderBody()
		</div>
	</div>

	<script src="http://resource.dfancy.cn/common/js/jquery-2.1.1.min.js" type="text/javascript"></script>
	<script src="http://resource.dfancy.cn/common/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="http://resource.dfancy.cn/common/js/angular.min.js" type="text/javascript"></script>
	<script src="http://resource.dfancy.cn/common/js/ui-bootstrap-tpls-0.11.0.min.js" type="text/javascript"></script>
	<script src="http://resource.dfancy.cn/common/js/angular-cookies.min.js" type="text/javascript"></script>

	<script type="text/javascript">
		$(document).ready(function () {
			//$('#nav_accordion .collapse').collapse('show');
		});

		function set_left_nav(el) {
			var item = $(el);

			item.addClass("active");
			item.parent().collapse('show');
		}

		angular.module('dpet', ['ngCookies', 'ui.bootstrap']);

		angular.module('dpet').controller('LoginBarController', function ($scope, $http) {
			$scope.alarmList = { Total: 0, Alarms: [] };

			var loadAlarmList = function () {
				$http.post('/Ajax/InventoryAlarmsForHeader')
					.success(function (alarms) {
						$scope.alarmList = alarms;
					});
			};

			loadAlarmList();
		});

	</script>

	@RenderSection("scripts", required: false)
</body>
</html>
